import React,{useState,useNavigate,useEffect} from 'react';
import axios from 'axios'
import {useSearchParams} from 'react-router-dom'
import Item from '../components/index'
const Index = (props) => {
    const [movie,setMovie] =useState([]);
    // const Navigate = useNavigate();
    let [query] = useSearchParams()
    const fecthData=async()=>{
        var id =query.get('id')
        var res =await axios.get(`http://122.112.161.135:4000/api/movieDetail?id=${id}`)
        setMovie(res.data.res)
    }
    useEffect(()=>{
        
        
        fecthData()
    })
    return (
        <div>
            <Item data={movie}></Item>
        </div>
    );
}

export default Index;
